![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
webext-detect
Advanced tools
Detects where the current browser extension code is being run. Compatible with Firefox, Chrome and derivates.
Detects where the current browser extension code is being run.
This package was recently renamed from
webext-detect-page
towebext-detect
You can download the standalone bundle and include it in your manifest.json
.
Or use npm
:
npm install webext-detect
import {isBackground, isContentScript} from 'webext-detect';
if (isBackground()) {
// Run background code, e.g.
browser.runtime.onMessage.addListener(console.log);
} else if (isContentScript()) {
// Run content script code, e.g.
browser.runtime.sendMessage('wow!');
}
The functions are only ever evaluated once. This protects from future "invalidated context" errors. Read the note about testing if you're running this code in a tester.
To see all the available functions, check the index.d.ts file.
There are also a few helper functions based on the useragent string to loosely detect the current browser: isChrome()
, isFirefox()
, isSafari()
, isMobileSafari()
. They are not intended to detect forks, but just the main engines.
The calls are automatically cached so, if you're using this in a test environment, import and call this function first to ensure that the environment is "detected" every time:
import {disableWebextDetectPageCache} from 'webext-detect';
disableWebextDetectPageCache();
MIT © Federico Brigante
FAQs
Detects where the current browser extension code is being run. Compatible with Firefox, Chrome and derivates.
The npm package webext-detect receives a total of 1,940 weekly downloads. As such, webext-detect popularity was classified as popular.
We found that webext-detect demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.